﻿@model IEnumerable<WarOfDev.EF.Post>

@{
    ViewBag.Title = "Index";
}


<div  class="container_12 grid_6 alpha">
<h2>All Cates</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
       
        <th>
            @Html.DisplayNameFor(model => model.Tags)
        </th>

        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
            
        <td>
            @Html.DisplayFor(modelItem => item.Tags)
        </td>

        <td>
           @if (ViewBag.currentDeveloperId == item.CreatedBy)
           {
                @Html.ActionLink("Edit", "Edit", new { id=item.Id }) 
            }
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
        </td>
    </tr>
}

</table>

</div>

<div  class="container_12 grid_3 omega">
    <div id="tagCloud">
    </div>
</div>

<div class="clear"></div>
@Scripts.Render("~/Scripts/jqcloud-1.0.1.min.js")
<script type="text/javascript">
    $.ajax({
        url: "@(Url.Action("Tags", "Cate", new { postType = WarOfDev.Core.Common.EnumPostType.Cate }))",
        type: "post",
        success: function (e) {
            $("#tagCloud").jQCloud(e,{width:260,height:200});
        }
    });
</script>